/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
 * the OAI Public License, Version 1.1  (the "License"); you may not use this
 * file except in compliance with the License. You may obtain a copy of the
 * License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */
/**
 * Nudr_DataRepository API OpenAPI file
 * Unified Data Repository Service. © 2020, 3GPP Organizational Partners (ARIB,
 * ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
 *
 * The version of the OpenAPI document: 2.1.2
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator
 * (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
 * the class manually.
 */

#include "SequenceNumber.h"

namespace oai::udr::model {

SequenceNumber::SequenceNumber() {
  m_SqnScheme = "";
  m_SqnSchemeIsSet = false;
  m_Sqn = "";
  m_SqnIsSet = false;
  m_LastIndexesIsSet = false;
  m_IndLength = 0;
  m_IndLengthIsSet = false;
  m_DifSignIsSet = false;
}

SequenceNumber::~SequenceNumber() {}

void SequenceNumber::validate() {
  // TODO: implement validation
}

void to_json(nlohmann::json &j, const SequenceNumber &o) {
  j = nlohmann::json();
  if (o.sqnSchemeIsSet())
    j["sqnScheme"] = o.m_SqnScheme;
  if (o.sqnIsSet())
    j["sqn"] = o.m_Sqn;
  if (o.lastIndexesIsSet() || !o.m_LastIndexes.empty())
    j["lastIndexes"] = o.m_LastIndexes;
  if (o.indLengthIsSet())
    j["indLength"] = o.m_IndLength;
  if (o.difSignIsSet())
    j["difSign"] = o.m_DifSign;
}

void from_json(const nlohmann::json &j, SequenceNumber &o) {
  if (j.find("sqnScheme") != j.end()) {
    j.at("sqnScheme").get_to(o.m_SqnScheme);
    o.m_SqnSchemeIsSet = true;
  }
  if (j.find("sqn") != j.end()) {
    j.at("sqn").get_to(o.m_Sqn);
    o.m_SqnIsSet = true;
  }
  if (j.find("lastIndexes") != j.end()) {
    j.at("lastIndexes").get_to(o.m_LastIndexes);
    o.m_LastIndexesIsSet = true;
  }
  if (j.find("indLength") != j.end()) {
    j.at("indLength").get_to(o.m_IndLength);
    o.m_IndLengthIsSet = true;
  }
  if (j.find("difSign") != j.end()) {
    j.at("difSign").get_to(o.m_DifSign);
    o.m_DifSignIsSet = true;
  }
}

std::string SequenceNumber::getSqnScheme() const { return m_SqnScheme; }
void SequenceNumber::setSqnScheme(std::string const &value) {
  m_SqnScheme = value;
  m_SqnSchemeIsSet = true;
}
bool SequenceNumber::sqnSchemeIsSet() const { return m_SqnSchemeIsSet; }
void SequenceNumber::unsetSqnScheme() { m_SqnSchemeIsSet = false; }
std::string SequenceNumber::getSqn() const { return m_Sqn; }
void SequenceNumber::setSqn(std::string const &value) {
  m_Sqn = value;
  m_SqnIsSet = true;
}
bool SequenceNumber::sqnIsSet() const { return m_SqnIsSet; }
void SequenceNumber::unsetSqn() { m_SqnIsSet = false; }
std::map<std::string, int32_t> &SequenceNumber::getLastIndexes() {
  return m_LastIndexes;
}
void SequenceNumber::setLastIndexes(
    std::map<std::string, int32_t> const value) {
  m_LastIndexes = value;
  m_LastIndexesIsSet = true;
}
bool SequenceNumber::lastIndexesIsSet() const { return m_LastIndexesIsSet; }
void SequenceNumber::unsetLastIndexes() { m_LastIndexesIsSet = false; }
int32_t SequenceNumber::getIndLength() const { return m_IndLength; }
void SequenceNumber::setIndLength(int32_t const value) {
  m_IndLength = value;
  m_IndLengthIsSet = true;
}
bool SequenceNumber::indLengthIsSet() const { return m_IndLengthIsSet; }
void SequenceNumber::unsetIndLength() { m_IndLengthIsSet = false; }
Sign SequenceNumber::getDifSign() const { return m_DifSign; }
void SequenceNumber::setDifSign(Sign const &value) {
  m_DifSign = value;
  m_DifSignIsSet = true;
}
bool SequenceNumber::difSignIsSet() const { return m_DifSignIsSet; }
void SequenceNumber::unsetDifSign() { m_DifSignIsSet = false; }

} // namespace oai::udr::model
